package ynu.edu.dto;

import lombok.Data;
import ynu.edu.entity.User;

@Data
public class UserDTO {
    private Integer userId;
    private String userName;
    private Integer userSex;
    private String userImg;
    private Integer delTag;

    public static UserDTO fromUser(User user) {
        UserDTO dto = new UserDTO();
        dto.setUserId(user.getUserId());
        dto.setUserName(user.getUserName());
        dto.setUserSex(user.getUserSex());
        dto.setUserImg(user.getUserImg());
        dto.setDelTag(user.getDelTag());
        return dto;
    }
} 